package com.atguigu.crowd.service.api;

import com.atguigu.crowd.entity.Admin;
import com.github.pagehelper.PageInfo;

import java.util.List;

public interface AdminService {

    List<Admin> getAll();

    /**
     * 根据账号密码查询用户
     * @param loginAcct String
     * @param userPswd  String
     * @return  Admin
     */
    Admin getAdminByLoginAcct(String loginAcct, String userPswd);

    /**
     * 分页查询admin
     *
     * @param keyword   String
     * @param pageSize  Integer
     * @param pageNum   Integer
     * @return  PageInfo<Admin>
     */
    PageInfo<Admin> getAdminPage(String keyword, Integer pageSize, Integer pageNum);

    /**
     * 保存admin
     *
     * @param admin Admin
     */
    void saveAdmin(Admin admin);

    /**
     * 删除admin
     * @param adminId Admin
     */
    void removeAdmin(Integer adminId);

    /**
     * 获取Admin
     * @param adminId   Integer
     */
    Admin getAdminById(Integer adminId);

    Admin getAdminByLoginAcct(String loginAcct);

    /**
     * 更新Admin
     *
     * @param admin Admin
     */
    void updateAdmin(Admin admin);

    void saveRoleRelationship(Integer adminId, List<Integer> roleIdList);
}
